# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-ping3
_pkgname=ping3
pkgver=4.0.8
pkgrel=3
pkgdesc='A pure python3 version of ICMP ping implementation using raw socket.'
arch=('any')
url='https://pypi.org/project/ping3/#files'
license=('ISC')
depends=('python')
makedepends=('python-build' 'python-pip' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('a6089a010934d6e397fcf41533fb660166f26ffb48a82a1fd988a85e2c058a6d7e7e96046a90c07b189d373d3406a3261736da680faea85c789363a712e373fa')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    "$_pkgname"
}

